# -*- coding: utf-8 -*-
import pandas as pd

# 导出的时间格式
TIME_FORMAT = '%Y-%m-%d %H:%M:%S'
LOG_TIME_FORMAT = '%Y%m%d'


def preprocessing(file_path: str) -> pd.DataFrame:
    """
    ## preprocessing\n
    Preprocess the file data in `file_path`
    :param file_path: CSV file path
    :return: Processed data
    """
    data = pd.read_csv(file_path)
    data['time'] = pd.to_datetime(data['time']).dt.strftime("%Y-%m-%d %H:%M:%S")
    data.sort_values(by='time', ascending=True, inplace=True)
    data.drop_duplicates(inplace=True)
    return data
